{extend name="layout" /}
{block name="body"}    
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">

          <form action="{:url('edit')}" method="post" name="edit-form" class="row edit-form">
            <div class="form-group col-md-12">
              <label for="pid">上级分类</label>
              <div class="form-controls">
                <select name="pid" class="form-control selectpicker" id="pid">
                  {volist name="types" id="vo"}
                  <option value="{$vo.id}" {if condition="$info.type_id == $vo.id"}selected{/if}>{$vo.title_show|raw}</option>
                  {/volist}
                </select>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="title">分类名称</label>
              <div class="form-controls">
                <input type="text" class="form-control" id="title" name="title" value="{$info.title}" placeholder="请输入分类名称" />
                <small class="form-text text-muted">(必填，30个字符以内!)</small>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="description">分类描述</label>
              <div class="form-controls">
                <textarea name="description" class="form-control" id="description" rows="3">{$info.description}</textarea>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="sort">排序</label>
              <div class="form-controls">
                <input type="text" class="form-control" id="sort" name="sort" value="{$info.sort}" />
              </div>
            </div>
            <div class="form-group col-md-12">
              <label>状态</label>
              <div class="form-controls clearfix">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" id="statusOne" name="status" class="custom-control-input" value="0" {if condition="$info.status == 0"}checked{/if}>
                  <label class="custom-control-label" for="statusOne">禁用</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" id="statusTwo" name="status" class="custom-control-input" value="1" {if condition="$info.status == 1"}checked{/if}>
                  <label class="custom-control-label" for="statusTwo">启用</label>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <input type="hidden" name="id" value="{$info.id}" />
              <button type="submit" class="btn btn-primary m-r-5 ajax-post" target-form="edit-form">确 定</button>
              <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
          </form>
 
        </div>
      </div>
    </div>
    
  </div>
{/block}